package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 题材对象 mini_subject
 * 
 * @author ruoyi
 * @date 2023-11-01
 */
@TableName(value = "mini_subject")
public class MiniSubject
{
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    /** 题材id */
    private Long subjectId;

    /** 父题材id */
    @Excel(name = "父题材id")
    private Long parentId;

    /** 祖级列表 */
    @Excel(name = "祖级列表")
    private String ancestors;

    /** 题材名称 */
    @Excel(name = "题材名称")
    private String name;

    /** 显示顺序 */
    @Excel(name = "显示顺序")
    private Integer orderNum;

    /** 概要 */
    @Excel(name = "概要")
    private String outline;

    /** 详情 */
    @Excel(name = "详情")
    private String detail;

    /** 重要性 */
    @Excel(name = "重要性")
    private Integer importance;

    /** 层级 */
    @Excel(name = "层级")
    private Integer level;

    /** 涨幅(乘以1000) */
    @Excel(name = "涨幅(乘以1000)")
    private BigDecimal rate;

    /** 题材状态（0正常 1停用） */
    @Excel(name = "题材状态", readConverterExp = "0=正常,1=停用")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 创建者 */
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 股票总数
     */
    private Integer stockCount;
    /**
     * 股票上涨总数
     */
    private Integer stockRiseCount;
    /**
     * 主线排序
     */
    private Integer mainSort;
    @TableField(exist = false)
    private String searchValue;
    /** 请求参数 */
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @TableField(exist = false)
    private Map<String, Object> params;

    @TableField(exist = false)
    private List<MiniSubject> children;

    @TableField(exist = false)
    private List<MiniStock> stocks;

    @TableField(exist = false)
    private String flag;
    public MiniSubject(){}
    public MiniSubject(Long subjectId, BigDecimal rate, Integer stockCount,Integer stockRiseCount) {
        this.subjectId = subjectId;
        this.rate = rate;
        this.stockCount = stockCount;
        this.stockRiseCount = stockRiseCount;
    }

    public MiniSubject(Long subjectId, Long parentId, String ancestors, String name, Integer orderNum, Integer level, String createBy, Date createTime) {
        this.subjectId = subjectId;
        this.parentId = parentId;
        this.ancestors = ancestors;
        this.name = name;
        this.orderNum = orderNum;
        this.level = level;
        this.createBy = createBy;
        this.createTime = createTime;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public Integer getStockCount() {
        return stockCount;
    }

    public void setStockCount(Integer stockCount) {
        this.stockCount = stockCount;
    }

    public Integer getStockRiseCount() {
        return stockRiseCount;
    }

    public void setStockRiseCount(Integer stockRiseCount) {
        this.stockRiseCount = stockRiseCount;
    }

    public Long getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(Long subjectId) {
        this.subjectId = subjectId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getOutline() {
        return outline;
    }

    public void setOutline(String outline) {
        this.outline = outline;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public Integer getImportance() {
        return importance;
    }

    public void setImportance(Integer importance) {
        this.importance = importance;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public BigDecimal getRate() {
        return rate;
    }

    public void setRate(BigDecimal rate) {
        this.rate = rate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getSearchValue() {
        return searchValue;
    }

    public void setSearchValue(String searchValue) {
        this.searchValue = searchValue;
    }

    public Map<String, Object> getParams() {
        if (params == null)
        {
            params = new HashMap<>();
        }
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }

    public List<MiniSubject> getChildren() {
        return children;
    }

    public void setChildren(List<MiniSubject> children) {
        this.children = children;
    }

    public List<MiniStock> getStocks() {
        return stocks;
    }

    public void setStocks(List<MiniStock> stocks) {
        this.stocks = stocks;
    }

    public Integer getMainSort() {
        return mainSort;
    }

    public void setMainSort(Integer mainSort) {
        this.mainSort = mainSort;
    }
}
